<!-- 导入静态文件服务模块 //-->
{% load static %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册页面</title>
    <!--用Bootstrap框架样式 //-->
    <link href="{% static 'blog/css/bootstrap.min.css' %}" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="row">
        <div align="center" style="margin-top:80px">
            <h2 class="form-signin-heading">请登录</h2>
        </div>
        <!--{% url 'blog:login' %}利用模板语言反向解析URL，用URL配置的名字解析出地址//-->
        <form method="post" action="{% url 'blog:login' %}" class="form-horizontal col-md-6 col-md-offset-3 login-form" >
            <!--安全机制，防止CSRF//-->
            {% csrf_token %}
            <div class="form-group">
                <label for="username" class="col-sm-2 control-label">用户名</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="username"name="username" placeholder="用户名">
                </div>
            </div>
            <div class="form-group">
                <label for="password" class="col-sm-2 control-label">密码</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="password"name="password"placeholder="密码">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
                    <!--{{ error }}显示错误信息，错误信息的内容由视图函数传递过来的//-->
                    <span style="color:red">{{ error }}</span>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- /container -->
<script src="{% static 'blog/js/jquery.js' %}"></script>
<script src="{% static 'blog/js/bootstrap.min.js'%}"></script>
</body>
</html>